package com.example.demo_yunpan.mapper;

import com.example.demo_yunpan.entity.recycle;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface RecycleMapper {
    /**
     * 根据账户ID查询回收站信息
     * @param userId
     * return 查询结果
     * */
    @Select("select * from recycle where user_id = #{userId}")
    List<recycle> getRecycleById(@Param("userId")String userId);

    /**
     *根据文件ID删除回收站文件
     * @param fileId
     * return
     * */
    @Delete("DELETE FROM recycle WHERE file_id = #{fileId}")
    boolean deleteRecycleFile(@Param("fileId")String fileId);

}
